package com.cnsoft.persistent.player.U102020Collect;

import javax.annotation.Resource;

import org.cnsoft.framework.beans.common.RESTResultBean;
import org.cnsoft.framework.db.page.PageModel;
import org.cnsoft.framework.support.MyControllerSupport;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * 会员收藏表接口
 */
@CrossOrigin
@RestController
@RequestMapping(value = "/api/1.0/base/u102020collect", method = { RequestMethod.POST })
public class U102020CollectApiController extends MyControllerSupport { // MyTokenCommonSupport
	@Resource
	protected U102020CollectBusinesslogic bizU102020Collect;

	// private MyModelAndViewSupport model =
	// super.getModelAndView("U102020_collect");

	// 一览（分页查询）
	@RequestMapping(value = "/list", method = RequestMethod.POST)
	public RESTResultBean<U102020CollectDBO> doList(U102020CollectDBO param, PageModel<U102020CollectDBO> pageModel) throws Exception {
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 设定查询参数
		pageModel.setFormParamBean(param);
		// 开启记录数统计
		// pageModel.setResultCountFlag(true);
		// 排序模式
		// pageModel.setOrderbyCreateTimeDESC();
		// 分页查询
		return bizU102020Collect.doList(pageModel);
	}

	// 信息详情
	@RequestMapping(value = "/info", method = RequestMethod.POST)
	public RESTResultBean<U102020CollectDBO> doInfo(U102020CollectDBO param) throws Exception {
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 数据查询
		return bizU102020Collect.doInfo(param);
	}

	// 信息插入
	@RequestMapping(value = "/append", method = RequestMethod.POST)
	public RESTResultBean<String> doAppend(U102020CollectDBO param) throws Exception {
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 信息插入
		return bizU102020Collect.doAppend(param);
	}

	// 信息编辑
	@RequestMapping(value = "/modify", method = RequestMethod.POST)
	public RESTResultBean<String> doModify(U102020CollectDBO param) throws Exception {
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 信息插入
		return bizU102020Collect.doModify(param);
	}

	// 信息删除
	@RequestMapping(value = "/discard", method = RequestMethod.POST)
	public RESTResultBean<String> doDiscard(U102020CollectDBO param) throws Exception {
		// 输出参数日志
		logger.debug("param=====>>>>" + param.toJsonString());
		// 信息插入
		return bizU102020Collect.doDiscard(param);
	}
}
